package Model::Presence_config;

use strict;
use utf8;
use Model::PresenceBase;
our @ISA=qw( Model::PresenceBase );

sub fields { [ qw/jid enable img_path js_str theme registered/ ] }
sub tablename { 'presence_config' }

sub reset_conf {
	my $this=shift;
	$this->set(
		img_path => '/elm/jabber/%{theme}/%{status}.png',
		'js_str' => q(<img src='%{img_src}' alt='Jabber-статус' />&nbsp;<b>%{jid}</b>[if1] Статусное сообщение: %{status_str}[/if1]),
		'theme' => 'default'
	);
	$this;
}

sub enabled_count {
	$_[0]->where( enable => 1 )->count
}

1;
